package com.hdcx.Minfresh.holder;

import android.support.v4.view.ViewPager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.youth.banner.Banner;

import com.hdcx.Minfresh.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/11/9.
 */
public class MainHolder extends RecyclerView.ViewHolder {

    public Banner banner;
    public ViewPager viewpager;
    public LinearLayout dot_layout, layout_all2, layout_all3;
    public TextView tv_hour, tv_point, tv_second, last_one;
    public LinearLayout[] layouts;
    public TextView[] tv_item1;
    public TextView[] tv_item2;
    public TextView[] tv_item3;
    public TextView[] tv_item4;
    public TextView[] tv_item5;
    public TextView[] tv_item6;
    public List<TextView[]> tvlist = new ArrayList<>();
    public TextView tv_title, tv_intro, tv_more;
    public ImageView[] imglists;
    public ImageView img_big;
    public ImageView[] img_mains;
    public TextView[] tv_mains;
    public View mLinearTimeGood;
    public TextView mTvLine2;
    public TextView mTvLine3;


    public MainHolder(View itemView, int type) {
        super(itemView);
        if (type == 0) {
            banner = (Banner) itemView.findViewById(R.id.banner);
            viewpager = (ViewPager) itemView.findViewById(R.id.main_viewpager);
            dot_layout = (LinearLayout) itemView.findViewById(R.id.dot_layout);
            tv_hour = (TextView) itemView.findViewById(R.id.tv_hour);
            tv_point = (TextView) itemView.findViewById(R.id.tv_point);
            tv_second = (TextView) itemView.findViewById(R.id.tv_second);
            tv_mains = new TextView[]{(TextView) itemView.findViewById(R.id.tv_main1), (TextView) itemView.findViewById(R.id.tv_main2), (TextView) itemView.findViewById(R.id.tv_main3), (TextView) itemView.findViewById(R.id.tv_main4), (TextView) itemView.findViewById(R.id.tv_main5), (TextView) itemView.findViewById(R.id.tv_main6)};
            img_mains = new ImageView[]{(ImageView) itemView.findViewById(R.id.img_main1), (ImageView) itemView.findViewById(R.id.img_main2), (ImageView) itemView.findViewById(R.id.img_main3), (ImageView) itemView.findViewById(R.id.img_main4), (ImageView) itemView.findViewById(R.id.img_main5), (ImageView) itemView.findViewById(R.id.img_main6)};
            mLinearTimeGood = itemView.findViewById(R.id.linearTimeGood);
        } else {
            layouts = new LinearLayout[]{(LinearLayout) itemView.findViewById(R.id.layout_item1), (LinearLayout) itemView.findViewById(R.id.layout_item2), (LinearLayout) itemView.findViewById(R.id.layout_item3), (LinearLayout) itemView.findViewById(R.id.layout_item4), (LinearLayout) itemView.findViewById(R.id.layout_item5), (LinearLayout) itemView.findViewById(R.id.layout_item6)};
            tv_item1 = new TextView[]{(TextView) itemView.findViewById(R.id.tv_item1_text1), (TextView) itemView.findViewById(R.id.tv_item1_text2), (TextView) itemView.findViewById(R.id.tv_item1_text3), (TextView) itemView.findViewById(R.id.tv_item1_text4), (TextView) itemView.findViewById(R.id.tv_item1_text5)};
            tv_item2 = new TextView[]{(TextView) itemView.findViewById(R.id.tv_item2_text1), (TextView) itemView.findViewById(R.id.tv_item2_text2), (TextView) itemView.findViewById(R.id.tv_item2_text3), (TextView) itemView.findViewById(R.id.tv_item2_text4), (TextView) itemView.findViewById(R.id.tv_item2_text5)};
            tv_item3 = new TextView[]{(TextView) itemView.findViewById(R.id.tv_item3_text1), (TextView) itemView.findViewById(R.id.tv_item3_text2), (TextView) itemView.findViewById(R.id.tv_item3_text3), (TextView) itemView.findViewById(R.id.tv_item3_text4), (TextView) itemView.findViewById(R.id.tv_item3_text5)};
            tv_item4 = new TextView[]{(TextView) itemView.findViewById(R.id.tv_item4_text1), (TextView) itemView.findViewById(R.id.tv_item4_text2), (TextView) itemView.findViewById(R.id.tv_item4_text3), (TextView) itemView.findViewById(R.id.tv_item4_text4), (TextView) itemView.findViewById(R.id.tv_item4_text5)};
            tv_item5 = new TextView[]{(TextView) itemView.findViewById(R.id.tv_item5_text1), (TextView) itemView.findViewById(R.id.tv_item5_text2), (TextView) itemView.findViewById(R.id.tv_item5_text3), (TextView) itemView.findViewById(R.id.tv_item5_text4), (TextView) itemView.findViewById(R.id.tv_item5_text5)};
            tv_item6 = new TextView[]{(TextView) itemView.findViewById(R.id.tv_item6_text1), (TextView) itemView.findViewById(R.id.tv_item6_text2), (TextView) itemView.findViewById(R.id.tv_item6_text3), (TextView) itemView.findViewById(R.id.tv_item6_text4), (TextView) itemView.findViewById(R.id.tv_item6_text5)};

            mTvLine2 = (TextView) itemView.findViewById(R.id.tvLine2);
            mTvLine3 = (TextView) itemView.findViewById(R.id.tvLine3);

            tvlist.add(tv_item1);
            tvlist.add(tv_item2);
            tvlist.add(tv_item3);
            tvlist.add(tv_item4);
            tvlist.add(tv_item5);
            tvlist.add(tv_item6);

            tv_title = (TextView) itemView.findViewById(R.id.tv_title);
            tv_intro = (TextView) itemView.findViewById(R.id.tv_intro);
            tv_more = (TextView) itemView.findViewById(R.id.text_more);
            last_one = (TextView) itemView.findViewById(R.id.last_one);
            layout_all2 = (LinearLayout) itemView.findViewById(R.id.layout_all2);
            layout_all3 = (LinearLayout) itemView.findViewById(R.id.layout_all3);

            img_big = (ImageView) itemView.findViewById(R.id.img_big);
            imglists = new ImageView[]{(ImageView) itemView.findViewById(R.id.img_item1), (ImageView) itemView.findViewById(R.id.img_item2), (ImageView) itemView.findViewById(R.id.img_item3), (ImageView) itemView.findViewById(R.id.img_item4), (ImageView) itemView.findViewById(R.id.img_item5), (ImageView) itemView.findViewById(R.id.img_item6)};
        }

    }
}
